﻿
function updatesum()
{
	var a =  parseInt(document.getElementById("number1").value);
	var b =  parseInt(document.getElementById("number2").value);
	var c = parseInt(document.getElementById("number3").value);
	var d = parseInt(document.getElementById("number4").value);
	document.getElementById("result").value = (d - b) / (c - a);
}

function predictAge() {
    var e = parseInt(document.getElementById("father").value);
    var f = parseInt(document.getElementById("mother").value);
    if (document.getElementById("Boy").checked == true) {
        document.getElementById("result2").value = (e + f + 12.7) / 2;
    }
    else if (document.getElementById("Girl").checked == true) {
        document.getElementById("result2").value = (e + f - 12.7) / 2;
    }
}

function updatelength() {
    var g = parseInt(document.getElementById("numer1").value);
    var h = parseInt(document.getElementById("numer2").value);
    var i = parseInt(document.getElementById("numer3").value);
    var j = parseInt(document.getElementById("numer4").value);
    document.getElementById("result3").value = (j - h) / ((i - g) / 4.3);
}

